package com.tingyukeji.fastpay.message.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.tingyukeji.fastpay.R;
import com.tingyukeji.fastpay.base.BaseActivity;
import com.tingyukeji.fastpay.databinding.MessageActivityBinding;
import com.tingyukeji.fastpay.message.adapter.MsgAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/11/11.
 */

public class MessageActivity extends BaseActivity implements View.OnClickListener {
    private MessageActivityBinding binding;
    private RecyclerView msgRecyclerView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void setContentView() {
        super.setContentView();
        binding = DataBindingUtil.setContentView(this, R.layout.message_activity);
    }

    @Override
    protected void initView() {
        super.initView();
        initMsgList();
    }

    private void initMsgList() {
        msgRecyclerView = (RecyclerView) binding.msgRecyclerView;
        List<Integer> commList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            commList.add(i);
        }
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        msgRecyclerView.setLayoutManager(linearLayoutManager); //给RecyClerView 添加设置好的布局样式
        MsgAdapter videoAdapter = new MsgAdapter(commList); //初始化适配器
        msgRecyclerView.setAdapter(videoAdapter); // 对 recyclerview 添加数据内容

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_next:
                break;
        }
    }

}
